import hips.Image;
import hips.Partition;
import ij.ImagePlus;
import ij.plugin.filter.PlugInFilter;
import ij.process.ImageProcessor;

@SuppressWarnings("rawtypes")
public class Example_ implements PlugInFilter{
	Image img;

    public int setup(String string, ImagePlus impl){
    	img = Image.getImage(impl);
        return DOES_RGB + DOES_8G + DOES_16 + DOES_32 + NO_CHANGES;
    }

    public void run(ImageProcessor ip){
    	Partition p = img.newPartition(Partition.IMPROVED_WITHOUT_CINDEX, img.newPixelValue(50), img.newPixelValue(100), 0, 10);
    	p.makeRegions();
    	System.out.println("Numero de regiones: " + p.getRegionSize());
		for (int i = 0; i < p.getLbl().length; i++){
			System.out.println("Pixel: " + i + ", Label: " + p.getLbl()[i]);
		}
    }
}